package com.design_patterns.builder;

/**
 * @author: 李德才
 * @description:
 * @create: 2020-09-19 15:19
 **/
public class PersonBuilder {
    private Integer id;
    private String name;
    private Integer age;
    private Integer sex;
    private Address address;

    public Integer getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public Integer getAge() {
        return age;
    }

    public Integer getSex() {
        return sex;
    }

    public Address getAddress() {
        return address;
    }

    public PersonBuilder builderId(Integer id) {
        this.id = id;
        return this;
    }

    public PersonBuilder builderName(String name) {
        this.name = name;
        return this;
    }

    public PersonBuilder builderAge(Integer age) {
        this.age = age;
        return this;
    }

    public PersonBuilder builderSex(Integer sex) {
        this.sex = sex;
        return this;
    }

    public PersonBuilder builderAddress(Address address) {
        this.address = address;
        return this;
    }

    public Person builder(){
        return new Person(this);
    }
}
